home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 143
/
(Vol 143) Nov 15 2011.iso
/
Games
/
cubic_shot_3.swf
/
scripts
/
frame_34
/
DoAction.as
Wrap
Text File
|
2011-11-15
|
5KB
|
209 lines
function heartMoveF()
{
user = _root.user_mc;
if(user._x < 300.3)
{
user._x = 300.3;
}
if(user._x > 375.3)
{
user._x = 375.3;
}
if(user._y < 45)
{
user._y = 45;
}
if(user._y > 170)
{
user._y = 170;
}
if(user._y <= 65.8)
{
user.gotoAndStop("rightDrawF2");
}
else if(user._y <= 81.7)
{
user.gotoAndStop("rightDrawF1");
}
else if(user._y <= 107)
{
user.gotoAndStop("drawF");
}
else if(user._y <= 146.7)
{
user.gotoAndStop("leftDrawF1");
}
else if(user._y <= 170)
{
user.gotoAndStop("leftDrawF2");
}
_root.heart_mc._x = _root.user_mc._x + 5.1;
_root.heart_mc._y = _root.user_mc._y + 33;
}
function combackF()
{
combackN++;
if(combackN == 11)
{
clearInterval(combackInter);
_root.user_mc.gotoAndStop("waitF");
}
else
{
_root.user_mc._x -= puDanX;
_root.user_mc._y -= puDanY;
}
}
function heartRotF(usX, usY)
{
stX = 300.3;
stY = 45;
throX = 0;
throY = 0;
chX = 10;
if(usX >= 260 && usX <= stX + 2)
{
throX = 7;
}
else if(usX > stX + 2 && usX <= stX + chX * ++throX)
{
throX = 7;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 6;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 5;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 4;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 3;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 2;
}
else if(usX > stX + (chX + throX) && usX <= stX + chX * ++throX)
{
throX = 1;
}
else if(usX > stX + (chX + throX) && usX <= 410)
{
throX = 1;
}
chY = 15;
if(usY >= 0 && usY <= stY + 2)
{
throY = 8;
}
else if(usY > stY + 2 && usY <= stY + chY * ++throY)
{
throY = 8;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 7;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 6;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 5;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 4;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 3;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 2;
}
else if(usY > stY + chY * throY && usY <= stY + chY * ++throY)
{
throY = 1;
}
else if(usY > stY + chY * throY && usY <= 310)
{
throY = 1;
}
_root.heartTrowF(throX,throY);
}
stop();
readyGame();
_root.user_mc.user_btn.onPress = function()
{
if(_root.userDreg == "yes")
{
_root.user_mc.startDrag();
if(soundon == "yes")
{
_root.lineDrawSound = new Sound(this);
_root.lineDrawSound.attachSound("lineDrawSoundM");
}
_root.lineDrawSound.start(0,999);
heartInter = setInterval(heartMoveF,5);
line_mc.gotoAndStop(2);
Mouse.addListener(mouseListener);
lineX = _root.user_mc._x + 10;
lineY = _root.user_mc._y + 40;
_root.createEmptyMovieClip("canvas_mc",-1);
canvas_mc.lineStyle(2,16760855,100);
canvas_mc.moveTo(297.9,71);
canvas_mc.lineTo(lineX,lineY);
_root.createEmptyMovieClip("canvas2_mc",-2);
canvas2_mc.lineStyle(2,16760855,100);
canvas2_mc.moveTo(297.9,197);
canvas2_mc.lineTo(lineX,lineY);
updateAfterEvent();
}
};
var mouseListener = new Object();
mouseListener.onMouseMove = function()
{
lineX = _root.user_mc._x + 10;
lineY = _root.user_mc._y + 40;
_root.createEmptyMovieClip("canvas_mc",-1);
canvas_mc.lineStyle(2,16760855,100);
canvas_mc.moveTo(297.9,71);
canvas_mc.lineTo(lineX,lineY);
_root.createEmptyMovieClip("canvas2_mc",-2);
canvas2_mc.lineStyle(2,16760855,100);
canvas2_mc.moveTo(297.9,197);
canvas2_mc.lineTo(lineX,lineY);
updateAfterEvent();
};
mouseListener.onMouseUp = function()
{
if(_root.userDreg == "yes")
{
clearInterval(heartInter);
Mouse.removeListener(mouseListener);
_root.userDreg = "no";
canvas_mc.clear();
canvas2_mc.clear();
_root.user_mc.stopDrag();
_root.lineDrawSound.stop();
delete _root.lineDrawSound;
_root.lineThrowSound.start();
_root.heartRotF(_root.user_mc._x,_root.user_mc._y);
puStartX = _root.user_mc._x;
puStartY = _root.user_mc._y;
puDanX = (puStartX - _root.userLocaX) / 10;
puDanY = (puStartY - _root.userLocaY) / 10;
combackN = 0;
combackInter = setInterval(combackF,50);
}
};